<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="../../project/css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="../../project/css/stylish-portfolio.css" rel="stylesheet" media="screen">
    <!-- Add custom CSS here -->

    <!-- Custom jquery-ui libraries-->

    <style>
        #draggable {
            width: 100px;
            height: 100px;
            padding: 0.5em;
            float: left;
            margin: 10px 10px 10px 0;
        }
    </style>

</head>
<body>

<script src="../../project/js/jquery-1.10.2.js"></script>
<script src="../../project/js/jquery-ui.js"></script>
<script src="../../project/js/bootstrap.js"></script>


<p>What kind of Version Control System do you know?</p>

<div id="frame1"></div>
<br>

<div id="frame2"></div>

<script>$(function () {
    answer = ['S', 'U', 'B', 'V', 'E', 'R', 'S', 'I', 'O', 'N'];
    gameranswer = [];
    click = 0;

    for (var i = 0; i < 10; i++) {
        $("#frame1").append("<div role='button'  class='btn btn-default' " + "id='a_id" + i + "' style='width: 50px; height: 50px'>" + " " + "</div>");
    }

    alpha = [2, 4, 9, 8, 3, 1, 7, 5, 0, 6];
    for (var i = 0; i < 10; i++) {
        //j = Math.floor((Math.random()*10));
        //console.log(j);
        $("#frame2").append("<div role='button' id='id" + i + "' class='btn btn-default' style='width: 50px; height: 50px'>" + answer[alpha[i]] + "</div>");
        $("#id" + i).draggable();
      console.log("#id" + i);
    }
    $(document).ready(function () {
        $(".btn_").click(function () {
            if (click >= 0 && click < 10) {
                console.log($(this).attr("id"));
                gameranswer.push($(this).text());
                console.log(gameranswer.toString() + " " + gameranswer.length);

                $("#a_id" + click).text("" + $(this).text());
                click++;
            } else
                console.log("Click is over 10");
        });
        $("#cancel").draggable();
    });
});
</script>

<br>
<div  class="btn btn-info" id="cancel">Cancel</div>

</body>
</html>